#!/bin/bash
set -euo pipefail

ENV_NAME="py310"
PYTHON_VERSION="3.10"
PYG_TORCH_VERSION="2.2.0+cpu"

CONDA_BASE=$(conda info --base 2>/dev/null)
if [ -z "$CONDA_BASE" ]; then
    exit 1
fi

source "$CONDA_BASE/etc/profile.d/conda.sh"

if ! conda env list | grep -q "${ENV_NAME}"; then
    conda create -n "${ENV_NAME}" python="${PYTHON_VERSION}" -y
fi

conda activate "${ENV_NAME}"

pip install omicverse
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f "https://data.pyg.org/whl/torch-${PYG_TORCH_VERSION}.html"
pip install torch_geometric
